namespace java edu.hawaii.ics.pjdb.types

/**
 * Encapsulates an address/port pair.
 */
struct RemoteAddress {
    1: string address;
    2: i32 port;
    
    /**
     * This is a utility flag to indicate to the plan runner that a server
     * should be opened on a remote machine, and not on the master.
     */
    3: bool remote = false;
}

/**
 * Encapsulates the information that may be needed to generate a plan
 * for a remote worker.
 */
struct WorkerInformation {

    /**
     * The address of the worker that will execute the command.
     */
    1: RemoteAddress workerAddress;
    
    /**
     * The address that the worker is listening on for input.
     */
    2: RemoteAddress inputAddress;
    
    /**
     * The address the worker will send output to.
     */
    3: RemoteAddress outputAddress;
    
    /**
     * The path to the embedded database that the worker will access.
     */
    4: string dbPath;
    
    /**
     * The name of the table that will be accessed.
     */
    5: string tableName;
}

/**
 * A data-type to represent a range of Strings based on the Java String's compareTo method.
 */
struct Range {

    /**
     * The smallest value of the range (inclusive).
     */
    1: string startValue;
    
    /**
     * The largest value of the range (inclusive).
     */
    2: string endValue;
}